package com.skeleton.db.dto;

import com.skeleton.common.base.dto.BaseDto;
import com.skeleton.db.entity.Userinfo;
import com.skeleton.utils.MD5Utils;
import com.skeleton.utils.SystemTools;

public class UserinfoDto extends BaseDto {

	private String userLoginname;
	private String userPassword;
	private int userCreateDttm;
	private String userCreateIp;
	private char userType;
	private char userStatus;

	private String userCreateDttmStr;

	public Userinfo toEntity() {
		Userinfo entity = new Userinfo();
		entity.setLoginname(userLoginname);
		entity.setPassword(userPassword);
		entity.setCreate_dttm(userCreateDttm);
		entity.setCreate_ip(userCreateIp);
		entity.setType(userType);
		entity.setStatus(userStatus);
		return entity;
	}

	public String getUserLoginname() {
		return userLoginname;
	}

	public void setUserLoginname(String userLoginname) {
		this.userLoginname = userLoginname;
	}

	public String getUserPassword() {
		return userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = MD5Utils.generateForPassword(userPassword);
	}

	public int getUserCreateDttm() {
		return userCreateDttm;
	}

	public void setUserCreateDttm(int userCreateDttm) {
		this.userCreateDttm = userCreateDttm;
		this.userCreateDttmStr = SystemTools.formatDTTM(SystemTools.convertIntToDTTM(userCreateDttm));
	}

	public String getUserCreateIp() {
		return userCreateIp;
	}

	public void setUserCreateIp(String userCreateIp) {
		this.userCreateIp = userCreateIp;
	}

	public char getUserType() {
		return userType;
	}

	public void setUserType(char userType) {
		this.userType = userType;
	}

	public char getUserStatus() {
		return userStatus;
	}

	public void setUserStatus(char userStatus) {
		this.userStatus = userStatus;
	}

	public String getUserCreateDttmStr() {
		return userCreateDttmStr;
	}

	public void setUserCreateDttmStr(String userCreateDttmStr) {
		this.userCreateDttmStr = userCreateDttmStr;
	}

}
